#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

int main(){
    pid_t pid = fork();
    pid_t pid1 = fork();

    if (pid == 0) {
        sleep(3);
        printf("I am son(%d)\n", getpid());
    } else {
        printf("I am father(%d)\n", getpid());
        pid_t recycle_pid = wait(NULL);
        printf("回收%d\n", recycle_pid);
        recycle_pid = wait(NULL);
        printf("回收%d\n", recycle_pid);
    }
}
